package com.tianhui.consignortwofei.mvp.ui.activity.hetong;

import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.fgs.common.CommonPresenter;
import com.fgs.common.CommonView;

import com.tianhui.consignortwofei.R;
import com.tianhui.consignortwofei.base.BaseDataListFragment;
import com.xuexiang.xui.widget.edittext.ClearEditText;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * @author fgs
 * @date 2020/8/27
 * @description
 **/
public abstract class HeTongSearchFragment<V extends CommonView, P extends CommonPresenter<V>> extends BaseDataListFragment<V, P> {

    @BindView(R.id.ll_search_body)
    LinearLayout ll_search_body;

    @BindView(R.id.layout_order_search_searchKeyEditText)
    ClearEditText mSearchKeyEditText;

    @BindView(R.id.fragment_contract_list_addContractButton)
    Button fragment_contract_list_addContractButton;

    @BindView(R.id.tv_shenhe)
    TextView tv_shenhe;



    @Override
    protected int getLayoutId() {
        return R.layout.fragment_contract_list;
    }
    public void setSearchKeyHint(String hint) {
        if (mSearchKeyEditText != null)
            mSearchKeyEditText.setHint(hint);
    }

    protected abstract void requestSearch(String searchKey);

    @OnClick(R.id.layout_order_search_searchTextView)
    public void search() {
        String searchKey = mSearchKeyEditText.getText().toString().trim();
        requestSearch(searchKey);
    }

}
